package bt

import (
	common "app/util"
)

type RangItemIterator func(key, value interface{}) bool

type Peers struct{
	pl common.SMap
	ip 	int
}
func NewPeersList(ip int) *Peers {
	peers := new (Peers)
	peers.ip = ip
	return peers
}
func (p *Peers) SetNode(key interface{},v interface{}) {

	p.pl.SetValue(key,v)
}
func (p *Peers) DelNode(key interface{}) {

	p.pl.DeleteValue(key)
}
func (p *Peers) GetNode(key interface{}) (v interface{}){
	value,_ := p.pl.GetValue(key)
	return value
}
func (p *Peers) RangNode (f RangItemIterator) {
	p.pl.Rang(f)
}



